﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EnterpriseSeniorSearch.aspx.cs" Inherits="RN.ERP.Web.Enterprise.EnterpriseSeniorSearch" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>企业高级查询</title>
    <script type="text/javascript" src="../Scripts/jquery.min.js"></script>
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript" src="../Scripts/json-data.js"></script>
    <script type="text/javascript">
        $(function () {
            var classId = $("#hdnClassID").val();
            var RoleId = $("#hdnRoleId").val();
            $("#btnOk").click(function () {
                var Status = $("#ddlStatus").val();
                var CorpUserType = $("#DDLCorpUserType").val();
                var CorpName = $("#txtCorpName").val();
                var OrginazationCode = ""; //$("#txtOrginazationCode").val();
                var AreaCode = $("#ddlAreaCode").val();
                var dataStr = GetData("btnOk");
                $.post("../Handlers/EnterpriseCorpInfoHandler.ashx", { "action": "SetQueryCondition", "data": dataStr, "rand": Math.random() }, function (data) {
                    var result = eval(data);
                    if (result.Result == true) {
                        parent.window.$("#ContentPlaceHolder1_txtCorpName").val(CorpName);
                        parent.window.$("#ContentPlaceHolder1_ddlStatus").val(Status);
                        parent.window.RefreshGrid(result.Condition);
                        window.parent.$.ligerDialog.close(); ////关闭dialog
                        parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
                    }
                    else {
                        $.ligerDialog.warn(result.Message);
                        return;
                    }

                }, "json");
            }
        );
            $("#ddlQualFirst").append("<option  value='-1@-1'>请选择</option>");
            $("#ddlQualSecond").append("<option  value='-1@-1'>请选择</option>");
            $("#ddlQualGrade").append("<option  value='-1@-1'>请选择</option>");
            $.post("../Handlers/CorpQualHandler.ashx", { "rootCode": RoleId, "parentId": 0, "rand": Math.random() }, function (data) {
                var result = eval(data);
                $("#ddlQualFirst option").remove();
                $("#ddlQualFirst").append("<option  value='-1@-1'>请选择</option>");
                $(result).each(function (key) {
                    var text = result[key].Title;
                    var value = result[key].Code + "@" + result[key].Id;
                    $("#ddlQualFirst").append("<option  value='" + value + "'>" + text + "</option>");

                });
            }, "json");
            $("#ddlQualFirst").change(function () {
                var qualFirst = $(this).val();
                $.post("../Handlers/CorpQualHandler.ashx", { "rootCode": RoleId, "parentId": qualFirst, "rand": Math.random() }, function (data) {
                    var result = eval(data);
                    $("#ddlQualSecond option").remove();
                    $("#ddlQualSecond").append("<option  value='-1@-1'>请选择</option>");
                    $(result).each(function (key) {
                        var text = result[key].Title;
                        var value = result[key].Code + "@" + result[key].Id;
                        $("#ddlQualSecond").append("<option  value='" + value + "'>" + text + "</option>");

                    });
                }, "json");
            }
            );
            $("#ddlQualSecond").change(function () {
                var qualSecond = $(this).val();
                $.post("../Handlers/CorpQualHandler.ashx", { "rootCode": RoleId, "parentId": qualSecond, "rand": Math.random() }, function (data) {
                    var result = eval(data);
                    $("#ddlQualGrade option").remove();
                    $("#ddlQualGrade").append("<option  value='-1@-1'>请选择</option>");
                    $(result).each(function (key) {
                        var text = result[key].Title;
                        var value = result[key].Code + "@" + result[key].Id;
                        $("#ddlQualGrade").append("<option  value='" + value + "'>" + text + "</option>");

                    });
                }, "json");
            }
            );
        });
    </script>
    <style type="text/css">
        table
        {
            border:1px solid #43a9f5;
            border-collapse:collapse;
            width:500px;
        }
        td
        {
            border:1px solid #43a9f5;
            border-collapse:collapse;
        }
        #btnOk
        {
            width:60px;
            height:25px;
            border:1px solid #43a9f5;
        }
        .about_title{ padding:0px 14px; height:26px; line-height:26px; text-align:center; background:#43a9f5; color:#fff; font-weight:bold; float:left;}
        .xian{ height:26px; border-bottom:1px #43a9f5 solid; padding:0px; margin-bottom:10px; margin-top:15px; width:500px;}
    </style>
</head>
<body>
    <form id="CorpSeniorSearchForm" runat="server">
    <div>
    <div class="xian"><div class="about_title">高级查询</div></div>
    <table table="CorpSeniorSearch" valtype="0" id="CorpSeniorSearch">
    <tr>
    <td>审核状态</td>
    <td>
        <asp:DropDownList ID="ddlStatus" runat="server" Width="100px" control="Status">
        </asp:DropDownList>
    </td>
    <%--<td>企业类型</td>
        <td>
            <asp:DropDownList ID="DDLCorpUserType" runat="server" Width="200px">
            </asp:DropDownList>
        </td>--%>
        <td >地区范围</td>
    <td ><asp:DropDownList ID="ddlAreaCode" runat="server" Width="100px" control="AreaCode">
            <asp:ListItem Text="全部" Value="-1" Selected="True"></asp:ListItem>
            <asp:ListItem Text="本地" Value="0" ></asp:ListItem>
            <asp:ListItem Text="外地" Value="1"></asp:ListItem>
        </asp:DropDownList></td>   
    </tr>
    <tr>
    <td >企业名称</td>
    <td colspan="3"><asp:TextBox ID="txtCorpName" runat="server" Width="200px" control="CorpName"></asp:TextBox></td>
        
    
    </tr>
    <%--<tr>
    <td >组织机构代码</td>
    <td colspan="3">
    <asp:TextBox ID="txtOrginazationCode" runat="server" Width="100px"></asp:TextBox>
    </td>
    </tr>--%>
    <tr>
    <td >主项资质</td>
    <td colspan="3">
    <asp:DropDownList ID="ddlQualFirst" runat="server" Width="100px" control="QualFirst">
        </asp:DropDownList>
        <asp:DropDownList ID="ddlQualSecond" runat="server" Width="100px" control="QualSecond">
        </asp:DropDownList>
        <asp:DropDownList ID="ddlQualGrade" runat="server" Width="100px" control="QualGrade">
        </asp:DropDownList>
    </td>
    </tr>
    <tr>
    <td colspan="4" align="center">
    <input type="hidden" id="hdnClassID" runat="server" control="ClassID" />
    <input type="hidden" id="hdnRoleId" runat="server" control="RoleId" />
    <input type="button" id="btnOk" value="确定" parentdiv="CorpSeniorSearch"/>
    </td>
    </tr>
    </table>
    </div>
    
    </form>
    
</body>
</html>
